package protectjava;


import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class CheckBox extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse respone) throws IOException {
        respone.setContentType("text/html;charset=UTF-8");

        PrintWriter out = respone.getWriter();
        String title = "读取复选框数据";
        String docType = "<!DOCTYPE html> \n";
            out.println(docType +
                    "<html>\n" +
                    "<head><title>"+title+ "</title></head> \n" +
                    "<body bgcolor = \"#fofofo\"> \n +" +
                    "<h1 align = \"center\">" + title + "</h1> \n " +
                    "<ul> \n " +
                    " <li> <b>菜鸟按教程标示：</b>:"
                    + request.getParameter("runoob") + "\n" +
                       "<li><b>Google 标示: </b>:"
                    + request.getParameter("google") + "\n" +
                    "<li><b>淘宝标识：</b>："
                    + request.getParameter("taobao") + "\n" +
                    "</ul>\n" +
                    "<body></html>");
    }

//    处理 post 请求方法 请求的方法
    public void doPost(HttpServletRequest request , HttpServletResponse response ) throws IOException {
        doGet(request,response);
    }
}
